<?php
	if (file_exists($_GET["dir"].$language->common->value_47.'.zip')){
		$archiv_file = don3_plus_one($language->common->value_47.'.zip', $_GET["dir"]);
	} else {
		$archiv_file = $_GET["dir"].$language->common->value_47.'.zip';
	}
	$archive = new PclZip($archiv_file);
	$keys = array_keys($_POST);
	$del_ids = array();
	foreach ($keys as $ids){
		if (strstr($ids, "item")){
			$del_ids[] = $ids;
		}
	}
	$restricted = 0;
	$error = 0;
	$files_num = 0;
	foreach ($del_ids as $del_me){
		if (!is_restricted($_POST[$del_me])){
			if ($files_num == 0){
				$archive->create($_POST[$del_me]);
			} else {
				$archive->add($_POST[$del_me]);
			}
			$files_num++;
		} else {
			$restricted++;
		}
	}
	
	if ($archive->errorInfo("code") != 0 OR $restricted > 0) {
    	oyster_log("ERROR",$archive->errorInfo(true),"PCL_ZIP");
    	$head->_template_assign("ERROR", $language->errors->value_28);
  	} else {
  		$head->_template_assign("STATUS", $language->stati->value_13);
  	}
  	$ordner = $_GET["dir"];
	$included = true;
	include("System/Kernel/Includes/index.include.php");
?>